<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<!-- Skrypt pochodzi z ksiki "101 praktycznych skryptw"  -->
<!-- autor: Marcin Lis    e-mail: 101scripts@marcinlis.com  -->
</HEAD>
<SCRIPT LANGUAGE= "JavaScript" type= "text/javascript">
<!-- Ukrycie przed przegldarkami nie obsugujcymi JavaScriptu
function init(){
 selector = document.getElementById('warstwa1').style;
 selector.top = screen.height / 2 - 160;
 selector.left = screen.width / 2 - 80;
}
function over(){
 topVal = parseInt(selector.top);
 leftVal = parseInt(selector.left);
 if (isNaN(topVal))
         topVal = screen.height / 2 - 160;
 if (isNaN(leftVal))
         leftVal = screen.width / 2 - 80;
 direction = Math.round ((Math.random() * 100) / (12.5));
 switch(direction){
         case 0 : {leftValAdd = 0; topValAdd = -160; break;}
         case 1 : {leftValAdd = 160; topValAdd = -160; break;}
         case 2 : {leftValAdd = 160; topValAdd = 0; break;}
         case 3 : {leftValAdd = 160; topValAdd = 160; break;}
         case 4 : {leftValAdd = 0; topValAdd = 160; break;}
         case 5 : {leftValAdd = -160; topValAdd = 160; break;}
         case 6 : {leftValAdd = -160; topValAdd = 0; break;}
         case 7 : {leftValAdd = -160; topValAdd = 160; break;}
 }
 newTopVal = topVal + topValAdd;
 newLeftVal = leftVal + leftValAdd;
 if (newTopVal < 0)
         newTopVal = screen.height - 160;
 if (newTopVal > screen.height - 160)
         newTopVal = 0;
 if (newLeftVal < 0)
         newLeftVal = screen.width - 160;
 if (newLeftVal > screen.width - 160)
         newLeftVal = 0;
 selector.top = newTopVal;
 selector.left = newLeftVal;
}
// Koniec kodu JavaScript -->
</SCRIPT>
<BODY onLoad="init()">
<DIV     ID = "warstwa1"
 STYLE = "visibility: visible;
         color: red; position: absolute;
         top: 10; left: 10;"
         onMouseOver = "over()">
<IMG SRC="imagex.gif">
</DIV>
<P>
Tutaj tekst strony
</P>
</BODY>
</HTML>
